<template>
<section style="width:100%;">
  <div class="content">
    <h1 v-if="active">激活成功！</h1>
    <h1 v-else>激活失败</h1>
    <h1><a href="http://www.advancersin.com/#/home">返回首页</a></h1>
  </div>
</section>

</template>

<script>
import axios from 'axios'
export default {
  name: 'EmailValid',
  data () {
    return {
      active: false
    }
  },
  created () {
    axios.get(`api/user/activationAccount/${this.$route.params.userid}`).then(res => {
      console.log(res)
      if (res.data.code === 0) {
        this.$message({
          type: 'success',
          message: '激活邮箱成功',
          duration: 2000
        })
        this.active = true
      } else {
        this.$message({
          type: 'error',
          message: res.data.msg,
          duration: 2000
        })
        this.active = false
      }
    }).catch(() => {})
  }
}
</script>

<style scoped>
.content{
  width:100%;
  margin:0 auto;
  align-content: center;
}
h1 {
  width:100%;
  /* align-content: center; */
  transform: translateX(50%);
}
</style>
